export default {
  /**
   * 从字符串中解析成cookie对象
   * @param {*} str
   */
  parseCookie(str) {
    if(!str){
      return {}
    }
    let arr = str.split(';')
    let cookie = {}
    arr.forEach(ele => {
      let c = ele.split('=')
      cookie[c[0].trim()] = c[1]
    })
    return cookie
  }
}
